package com.xqit.ydzhkt.answer.controller;

import com.github.pagehelper.PageHelper;
import com.xqit.ydzhkt.answer.service.ListTeacherService;
import com.xqit.ydzhkt.entity.Teacher;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Janus on 2020/6/9
 */
@RestController
@RequestMapping("/list")
@Api(tags = "查询用户模块")
public class ListTeacherController {
    @Autowired
    private ListTeacherService listTeacherService;
    @GetMapping("/listTeacher")
    @ApiOperation("查询全部教师")
    public List<Teacher> listTeacher( @RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum,@RequestParam(defaultValue = "2",value = "pageSize") Integer pageSize){
        PageHelper.startPage(pageNum,pageSize);
        List<Teacher> teachers = listTeacherService.listTeacher();
        return teachers;

    }

}
